package com.naico.core.service.comparator;

import com.naico.core.pojo.DebtInformation;

/**
 * User: Dawood Ajaz
 * Date: Jan 5, 2009
 * Time: 9:17:48 PM
 */
public class AscendingMonthsToPayOffComparator implements DebtOrderComparator {

    public int compare(DebtInformation debtInfo1, DebtInformation debtInfo2) {
        double debtInfo1Int = debtInfo1.getMonthsToPayOff();
        double debtInfo2Int = debtInfo2.getMonthsToPayOff();

        if (debtInfo1Int > debtInfo2Int) {
            return 1;
        } else if (debtInfo1Int < debtInfo2Int) {
            return -1;
        } else {
            return 0;
        }
    }
}